// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false


const cpn ={
  template:'<div>我是组件{{message}}</div>',
  data(){
    return{
      message:'我是组件message'
    }
  }
}

/* eslint-disable no-new */
new Vue({
  el: '#app',
  render:function(createElement) {
  // 1.普通用法createElement（‘标签’,'{标签的属性}',['']）
  // return createElement('h2',
  //   {class:'box'},
  //   ['Hello World',createElement('button',['按钮'])])

  // 2.传入一个组件对象
  return createElement(cpn);
  return createElement(App)


}
  // components: { App },
  // template: '<App/>'
})

//runtime-compiler
//template->ast->render->vDOM->UI

//runtime-only(性能更好，速度更快)
//render-vDOM->UI


// render函数
// render:function(createElement) {
//   // 1.createElement（‘标签’,'{标签的属性}',['']）
//   return createElement('h2',{class:'box'},['Hello World'])
// }
